/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package acscoreserver;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Map;

/**
 *
 * @author Ricardo
 */
public class ACServerProcess {
    
    
    private ProcessBuilder builder;
    private Map<String, String> environ;
    public Process process;
    private InputStream is;
    private InputStreamReader isr;
    private BufferedReader br;


    public ACServerProcess(String commandfile,String dir){


        try {
            builder = new ProcessBuilder(dir+commandfile);
            environ = builder.environment();
            builder.directory(new File(dir));


            process = builder.start();
            is = process.getInputStream();
            isr = new InputStreamReader(is);
            br = new BufferedReader(isr);

        }catch (IOException ex) {
            System.out.println("\n\nACServerProcess.java:45:IOException: "+ex.getMessage());
        }


    }

    /**
     * @return the br
     */
    public BufferedReader getBr() {
        return br;
    }

}
